﻿<UserControl x:Class="SoftSource.Controls.LoginView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:toolkitControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
             xmlns:dataform="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
             xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
             xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
             xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
             KeyDown="LoginPanel_KeyDown">

    <UserControl.Resources>
        <!-- LoginDataForm Style -->
        <Style x:Key="LoginDataFormStyle"
               TargetType="dataControls:DataForm">
            <Setter Property="MinWidth"
                    Value="380" />
            <Setter Property="AutoCommit"
                    Value="True" />
            <Setter Property="AutoGenerateFields"
                    Value="True" />
            <Setter Property="Background"
                    Value="Transparent" />
            <Setter Property="BorderThickness"
                    Value="0" />
            <Setter Property="BorderBrush"
                    Value="Transparent" />
            <Setter Property="DescriptionViewerPosition"
                    Value="Auto" />
            <Setter Property="LabelPosition"
                    Value="Auto" />
            <Setter Property="HeaderVisibility"
                    Value="Collapsed" />
            <Setter Property="Padding"
                    Value="0" />
            <Setter Property="Margin"
                    Value="0,0" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="dataControls:DataForm">
                        <Grid dataControls:DataField.IsFieldGroup="True">
                            <Grid.Resources>
                                <Style x:Key="ButtonGeneric"
                                       TargetType="Button">
                                    <Setter Property="Background"
                                            Value="#00000000" />
                                    <Setter Property="Foreground"
                                            Value="#FF000000" />
                                    <Setter Property="BorderBrush"
                                            Value="#FFFFFFFF" />
                                    <Setter Property="BorderThickness"
                                            Value="1" />
                                    <Setter Property="Padding"
                                            Value="1" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="Button">
                                                <Grid>
                                                    <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                            <VisualState x:Name="Normal" />
                                                            <VisualState x:Name="MouseOver">
                                                                <Storyboard>
                                                                    <ColorAnimation Duration="0"
                                                                                    Storyboard.TargetName="OuterBtnBorder"
                                                                                    Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                                                                    To="#FFFFFFFF" />
                                                                    <ColorAnimation Duration="0"
                                                                                    Storyboard.TargetName="InnerBtnBorder"
                                                                                    Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                                                                    To="#7FA9A9A9" />
                                                                </Storyboard>
                                                            </VisualState>
                                                            <VisualState x:Name="Pressed">
                                                                <Storyboard>
                                                                    <ColorAnimation Duration="0"
                                                                                    Storyboard.TargetName="InnerBtnBorder"
                                                                                    Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                                                                    To="#7FA9A9A9" />
                                                                    <ColorAnimation Duration="0"
                                                                                    Storyboard.TargetName="InnerBtnBorder"
                                                                                    Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
                                                                                    To="#7FA9A9A9" />
                                                                </Storyboard>
                                                            </VisualState>
                                                            <VisualState x:Name="Disabled">
                                                                <Storyboard>
                                                                    <DoubleAnimation Duration="0"
                                                                                     Storyboard.TargetName="contentPresenter"
                                                                                     Storyboard.TargetProperty="Opacity"
                                                                                     To="0.3" />
                                                                </Storyboard>
                                                            </VisualState>
                                                        </VisualStateGroup>
                                                        <VisualStateGroup x:Name="FocusStates">
                                                            <VisualState x:Name="Focused">
                                                                <Storyboard>
                                                                    <DoubleAnimation Duration="0"
                                                                                     Storyboard.TargetName="FocusVisualElement"
                                                                                     Storyboard.TargetProperty="Opacity"
                                                                                     To="1" />
                                                                </Storyboard>
                                                            </VisualState>
                                                            <VisualState x:Name="Unfocused" />
                                                        </VisualStateGroup>
                                                    </VisualStateManager.VisualStateGroups>
                                                    <Border x:Name="OuterBtnBorder"
                                                            Background="{TemplateBinding Background}"
                                                            BorderBrush="#00FFFFFF"
                                                            BorderThickness="{TemplateBinding BorderThickness}"
                                                            CornerRadius="3">
                                                        <Border x:Name="InnerBtnBorder"
                                                                Background="#00A9A9A9"
                                                                BorderBrush="#00A9A9A9"
                                                                BorderThickness="{TemplateBinding BorderThickness}"
                                                                CornerRadius="2">
                                                            <ContentPresenter x:Name="contentPresenter"
                                                                              Height="Auto"
                                                                              HorizontalAlignment="Center"
                                                                              VerticalAlignment="Center"
                                                                              Width="Auto"
                                                                              Content="{TemplateBinding Content}"
                                                                              ContentTemplate="{TemplateBinding ContentTemplate}" />
                                                        </Border>
                                                    </Border>
                                                    <Border x:Name="FocusVisualElement"
                                                            Margin="1"
                                                            Opacity="0"
                                                            Background="{TemplateBinding Background}"
                                                            BorderBrush="#FF6DBDD1"
                                                            BorderThickness="{TemplateBinding BorderThickness}"
                                                            CornerRadius="2" />
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                                <Style x:Key="CustomScrollViewerStyle"
                                       TargetType="ScrollViewer">
                                    <Setter Property="HorizontalContentAlignment"
                                            Value="Left" />
                                    <Setter Property="VerticalContentAlignment"
                                            Value="Top" />
                                    <Setter Property="BorderThickness"
                                            Value="0,1" />
                                    <Setter Property="BorderBrush">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,1"
                                                                 StartPoint="0.5,0">
                                                <GradientStop Color="#FFA3AEB9"
                                                              Offset="0" />
                                                <GradientStop Color="#FF8399A9"
                                                              Offset="0.375" />
                                                <GradientStop Color="#FF718597"
                                                              Offset="0.375" />
                                                <GradientStop Color="#FF617584"
                                                              Offset="1" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="ScrollViewer">
                                                <Grid>
                                                    <Border Margin="0,-1"
                                                            Opacity="0.2"
                                                            BorderBrush="{TemplateBinding BorderBrush}"
                                                            BorderThickness="{TemplateBinding BorderThickness}">
                                                        <Border.OpacityMask>
                                                            <LinearGradientBrush EndPoint="1.07,0.5"
                                                                                 StartPoint="-0.07,0.5">
                                                                <GradientStop Color="#FF000000" />
                                                                <GradientStop Color="#7FFFFFFF"
                                                                              Offset="0.5" />
                                                                <GradientStop Color="#FF000000"
                                                                              Offset="1" />
                                                            </LinearGradientBrush>
                                                        </Border.OpacityMask>
                                                    </Border>
                                                    <Grid Background="{TemplateBinding Background}">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="*" />
                                                            <ColumnDefinition Width="Auto" />
                                                        </Grid.ColumnDefinitions>
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="*" />
                                                            <RowDefinition Height="Auto" />
                                                        </Grid.RowDefinitions>
                                                        <ScrollContentPresenter x:Name="ScrollContentPresenter"
                                                                                Cursor="{TemplateBinding Cursor}"
                                                                                Margin="{TemplateBinding Padding}"
                                                                                ContentTemplate="{TemplateBinding ContentTemplate}" />
                                                        <Rectangle Fill="#FFE9EEF4"
                                                                   Grid.Column="1"
                                                                   Grid.Row="2" />
                                                        <ScrollBar x:Name="VerticalScrollBar"
                                                                   Margin="0,-1"
                                                                   Width="18"
                                                                   Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                                                   IsTabStop="False"
                                                                   Grid.Column="1"
                                                                   Grid.Row="1"
                                                                   Maximum="{TemplateBinding ScrollableHeight}"
                                                                   Minimum="0"
                                                                   Value="{TemplateBinding VerticalOffset}"
                                                                   Orientation="Vertical"
                                                                   ViewportSize="{TemplateBinding ViewportHeight}" />
                                                        <ScrollBar x:Name="HorizontalScrollBar"
                                                                   Height="18"
                                                                   Margin="-1,0,-1,-1"
                                                                   Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                                                   IsTabStop="False"
                                                                   Grid.Column="0"
                                                                   Grid.Row="2"
                                                                   Maximum="{TemplateBinding ScrollableWidth}"
                                                                   Minimum="0"
                                                                   Value="{TemplateBinding HorizontalOffset}"
                                                                   Orientation="Horizontal"
                                                                   ViewportSize="{TemplateBinding ViewportWidth}" />
                                                    </Grid>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Grid.Resources>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="Disabled" />
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="ModeStates">
                                    <VisualState x:Name="Display" />
                                    <VisualState x:Name="Empty">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                           Storyboard.TargetName="ContentPresenter"
                                                                           Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                        Value="False" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation Duration="0"
                                                             Storyboard.TargetName="ContentPresenter"
                                                             Storyboard.TargetProperty="Opacity"
                                                             To="0" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Edit">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                           Storyboard.TargetName="EditButton"
                                                                           Storyboard.TargetProperty="IsEnabled">
                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                        Value="false" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                           Storyboard.TargetName="CommitButton"
                                                                           Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                        Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                                           Storyboard.TargetName="CancelButton"
                                                                           Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                        Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="ValidationStates">
                                    <VisualState x:Name="Valid" />
                                    <VisualState x:Name="Invalid" />
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommittedStates">
                                    <VisualState x:Name="Committed" />
                                    <VisualState x:Name="Uncommitted">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0"
                                                             Storyboard.TargetName="ChangeIndicator"
                                                             Storyboard.TargetProperty="Opacity"
                                                             To="0.9" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="ScopeStates">
                                    <VisualState x:Name="Entity" />
                                    <VisualState x:Name="Collection" />
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="DataFormBorder"
                                    Background="{TemplateBinding Background}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="0"
                                    Margin="-6,0,-6,0">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Grid MinHeight="27"
                                          Visibility="{TemplateBinding HeaderVisibility}">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="8" />
                                        </Grid.ColumnDefinitions>
                                        <StackPanel Orientation="Horizontal">
                                            <ContentControl x:Name="HeaderElement"
                                                            Margin="0,0,0,0"
                                                            VerticalAlignment="Center"
                                                            Foreground="{TemplateBinding Foreground}"
                                                            Content="{TemplateBinding Header}"
                                                            ContentTemplate="{TemplateBinding HeaderTemplate}" />
                                            <TextBlock x:Name="ChangeIndicator"
                                                       Margin="3,-2,8,2"
                                                       VerticalAlignment="Center"
                                                       Opacity="0"
                                                       FontWeight="Bold"
                                                       Foreground="{TemplateBinding Foreground}"
                                                       Text="*" />
                                        </StackPanel>
                                        <StackPanel Margin="0,3,0,2"
                                                    Grid.Column="2"
                                                    Orientation="Horizontal">
                                            <Button x:Name="FirstItemButton"
                                                    Style="{StaticResource ButtonGeneric}">
                                                <Grid Height="9"
                                                      Margin="6,5,5,5"
                                                      Width="8"
                                                      Opacity="1">
                                                    <Grid.OpacityMask>
                                                        <LinearGradientBrush EndPoint="0.6,1"
                                                                             StartPoint="0.4,0">
                                                            <GradientStop Color="#7FFFFFFF"
                                                                          Offset="0" />
                                                            <GradientStop Color="#BF000000"
                                                                          Offset="0.25" />
                                                            <GradientStop Color="#FF000000"
                                                                          Offset="1" />
                                                        </LinearGradientBrush>
                                                    </Grid.OpacityMask>
                                                    <Grid.Effect>
                                                        <DropShadowEffect BlurRadius="8"
                                                                          Color="#FFFFFFFF"
                                                                          Direction="100"
                                                                          Opacity="1"
                                                                          ShadowDepth="0" />
                                                    </Grid.Effect>
                                                    <Path Fill="{TemplateBinding Foreground}"
                                                          Stretch="Fill"
                                                          Height="9"
                                                          HorizontalAlignment="Right"
                                                          Margin="0"
                                                          Width="5"
                                                          Opacity="0.85"
                                                          Data="M1,0 L1,2 L0,1 Z" />
                                                    <Rectangle Fill="{TemplateBinding Foreground}"
                                                               HorizontalAlignment="Left"
                                                               Width="2"
                                                               Opacity="0.85" />
                                                </Grid>
                                            </Button>
                                            <Button x:Name="PreviousItemButton"
                                                    Style="{StaticResource ButtonGeneric}">
                                                <Path Fill="{TemplateBinding Foreground}"
                                                      Stretch="Fill"
                                                      Height="9"
                                                      Margin="6,5,8,5"
                                                      Width="5"
                                                      Opacity="0.85"
                                                      Data="M1,0 L1,2 L0,1 Z">
                                                    <Path.OpacityMask>
                                                        <LinearGradientBrush EndPoint="0.6,1"
                                                                             StartPoint="0.4,0">
                                                            <GradientStop Color="#7F000000"
                                                                          Offset="0" />
                                                            <GradientStop Color="#BF000000"
                                                                          Offset="0.25" />
                                                            <GradientStop Color="#FF000000"
                                                                          Offset="1" />
                                                        </LinearGradientBrush>
                                                    </Path.OpacityMask>
                                                    <Path.Effect>
                                                        <DropShadowEffect BlurRadius="8"
                                                                          Color="#FFFFFFFF"
                                                                          Direction="100"
                                                                          ShadowDepth="0" />
                                                    </Path.Effect>
                                                </Path>
                                            </Button>
                                            <Button x:Name="NextItemButton"
                                                    Style="{StaticResource ButtonGeneric}">
                                                <Path Fill="{TemplateBinding Foreground}"
                                                      Stretch="Fill"
                                                      Height="9"
                                                      Margin="8,5,6,5"
                                                      Width="5"
                                                      Opacity="0.85"
                                                      Data="M0,0 L1,1 L0,2 Z">
                                                    <Path.OpacityMask>
                                                        <LinearGradientBrush EndPoint="0.6,1"
                                                                             StartPoint="0.4,0">
                                                            <GradientStop Color="#7F000000"
                                                                          Offset="0" />
                                                            <GradientStop Color="#BF000000"
                                                                          Offset="0.25" />
                                                            <GradientStop Color="#FF000000"
                                                                          Offset="1" />
                                                        </LinearGradientBrush>
                                                    </Path.OpacityMask>
                                                    <Path.Effect>
                                                        <DropShadowEffect BlurRadius="8"
                                                                          Color="#FFFFFFFF"
                                                                          Direction="100"
                                                                          ShadowDepth="0" />
                                                    </Path.Effect>
                                                </Path>
                                            </Button>
                                            <Button x:Name="LastItemButton"
                                                    Style="{StaticResource ButtonGeneric}">
                                                <Grid Height="9"
                                                      Margin="6,5,5,5"
                                                      Width="8"
                                                      Opacity="1">
                                                    <Grid.OpacityMask>
                                                        <LinearGradientBrush EndPoint="0.6,1"
                                                                             StartPoint="0.4,0">
                                                            <GradientStop Color="#7F000000"
                                                                          Offset="0" />
                                                            <GradientStop Color="#BF000000"
                                                                          Offset="0.25" />
                                                            <GradientStop Color="#FF000000"
                                                                          Offset="1" />
                                                        </LinearGradientBrush>
                                                    </Grid.OpacityMask>
                                                    <Grid.Effect>
                                                        <DropShadowEffect BlurRadius="8"
                                                                          Color="#FFFFFFFF"
                                                                          Direction="100"
                                                                          ShadowDepth="0" />
                                                    </Grid.Effect>
                                                    <Path Fill="{TemplateBinding Foreground}"
                                                          Stretch="Fill"
                                                          Height="9"
                                                          HorizontalAlignment="Left"
                                                          Width="5"
                                                          Opacity="0.85"
                                                          Data="M0,0 L1,1 L0,2 Z" />
                                                    <Rectangle Fill="{TemplateBinding Foreground}"
                                                               HorizontalAlignment="Right"
                                                               Width="2"
                                                               Opacity="0.85" />
                                                </Grid>
                                            </Button>
                                            <Border x:Name="ButtonSeparator"
                                                    Margin="2,4,2,4"
                                                    Width="3"
                                                    Opacity="0.2"
                                                    Background="{TemplateBinding BorderBrush}"
                                                    BorderBrush="#59FFFFFF"
                                                    BorderThickness="1,0,1,0" />
                                            <Button x:Name="EditButton"
                                                    Style="{StaticResource ButtonGeneric}"
                                                    ToolTipService.ToolTip="Edit">
                                                <Button.OpacityMask>
                                                    <LinearGradientBrush EndPoint="0.57,0.76"
                                                                         StartPoint="0.42,0.01">
                                                        <GradientStop Color="#7F000000"
                                                                      Offset="0" />
                                                        <GradientStop Color="#BF000000"
                                                                      Offset="0.442" />
                                                        <GradientStop Color="#FF000000"
                                                                      Offset="1" />
                                                    </LinearGradientBrush>
                                                </Button.OpacityMask>
                                                <Grid Height="19"
                                                      HorizontalAlignment="Center"
                                                      VerticalAlignment="Center"
                                                      Width="19">
                                                    <Canvas HorizontalAlignment="Stretch"
                                                            Margin="2,2,0,0"
                                                            VerticalAlignment="Stretch">
                                                        <Path Fill="{TemplateBinding Foreground}"
                                                              Stretch="Fill"
                                                              Height="10.5"
                                                              Width="10.56"
                                                              Canvas.Left="2.53"
                                                              Canvas.Top="3.01"
                                                              Data="F1 M 2.53,9.96L 4.96,11.1L 6.08,13.50L 13.09,6.50L 9.6,3L 2.53,9.96 Z ">
                                                            <Path.OpacityMask>
                                                                <LinearGradientBrush EndPoint="0.76,0.77"
                                                                                     StartPoint="0.21,0.18">
                                                                    <GradientStop Color="#7F000000"
                                                                                  Offset="0" />
                                                                    <GradientStop Color="#59000000"
                                                                                  Offset="0.106" />
                                                                    <GradientStop Color="#3F000000"
                                                                                  Offset="0.387" />
                                                                    <GradientStop Color="#99000000"
                                                                                  Offset="0.703" />
                                                                    <GradientStop Color="#CC000000"
                                                                                  Offset="1" />
                                                                </LinearGradientBrush>
                                                            </Path.OpacityMask>
                                                        </Path>
                                                        <Path Fill="{TemplateBinding Foreground}"
                                                              Stretch="Fill"
                                                              Height="6.74"
                                                              Width="6.81"
                                                              Canvas.Left="7.47"
                                                              Canvas.Top="1.89"
                                                              Data="M1.41,1.83 L0.71,2.54 L4.20,6.03 L4.91,5.33 z M3.24,0 L6.81,3.42 L3.5,6.74 L0,3.24 z" />
                                                        <Path Stretch="Fill"
                                                              Stroke="{TemplateBinding Foreground}"
                                                              StrokeLineJoin="Round"
                                                              Height="12.5"
                                                              Width="12.43"
                                                              Canvas.Left="2.03"
                                                              Canvas.Top="1.50"
                                                              Data="F1 M 13.77,4.22L 11.73,2.18C 11.12,1.78 10.46,2.15 10,2.5L 3.04,9.45C 2.65,9.86 2.53,10.47 2.53,10.73L 2.53,13.5L 5.32,13.5C 5.57,13.5 6.33,13.36 6.64,12.93L 13.54,6.03C 13.86,5.72 14.17,4.74 13.77,4.22 Z" />
                                                        <Path Fill="{TemplateBinding Foreground}"
                                                              Stretch="Fill"
                                                              Height="2.29"
                                                              Width="2.33"
                                                              Canvas.Left="2.58"
                                                              Canvas.Top="11.18"
                                                              Data="F1 M 2.033,11.71L 4.33,14L 2.62,14C 2.17,13.93 2.09,13.79 2,13.31L 2.03,11.71 Z" />
                                                    </Canvas>
                                                </Grid>
                                            </Button>
                                            <Button x:Name="NewItemButton"
                                                    Style="{StaticResource ButtonGeneric}"
                                                    ToolTipService.ToolTip="Add">
                                                <Path Fill="{TemplateBinding Foreground}"
                                                      Stretch="Fill"
                                                      Height="9"
                                                      HorizontalAlignment="Center"
                                                      Margin="5"
                                                      VerticalAlignment="Center"
                                                      Width="9"
                                                      Opacity="0.85"
                                                      RenderTransformOrigin="0.5,0.5"
                                                      Data="F1 M18.41,61.67 L19.56,60.52 L21.92,62.88 L24.22,60.57 L25.36,61.72 L23.06,64.03 L25.43,66.4 L24.22,67.60 L21.87,65.25 L19.56,67.56 L18.41,66.41 L20.73,64.08 L18.41,61.67 z">
                                                    <Path.RenderTransform>
                                                        <TransformGroup>
                                                            <ScaleTransform />
                                                            <SkewTransform />
                                                            <RotateTransform Angle="45" />
                                                            <TranslateTransform X="0.18"
                                                                                Y="-0.07" />
                                                        </TransformGroup>
                                                    </Path.RenderTransform>
                                                    <Path.Effect>
                                                        <DropShadowEffect BlurRadius="8"
                                                                          Color="#FFFFFFFF"
                                                                          Direction="100"
                                                                          ShadowDepth="0" />
                                                    </Path.Effect>
                                                    <Path.OpacityMask>
                                                        <LinearGradientBrush EndPoint="0.35,0.5"
                                                                             StartPoint="-0.27,0.05">
                                                            <GradientStop Color="#7F000000"
                                                                          Offset="0" />
                                                            <GradientStop Color="#BF000000"
                                                                          Offset="0.25" />
                                                            <GradientStop Color="#FF000000"
                                                                          Offset="1" />
                                                        </LinearGradientBrush>
                                                    </Path.OpacityMask>
                                                </Path>
                                            </Button>
                                            <Button x:Name="DeleteItemButton"
                                                    Style="{StaticResource ButtonGeneric}"
                                                    ToolTipService.ToolTip="Delete">
                                                <Path Fill="{TemplateBinding Foreground}"
                                                      Stretch="Fill"
                                                      Height="9"
                                                      HorizontalAlignment="Center"
                                                      Margin="5,5,5,5"
                                                      VerticalAlignment="Center"
                                                      Width="9"
                                                      Opacity="0.85"
                                                      RenderTransformOrigin="0.5,0.5"
                                                      Data="F1 M24.32,60.48 L25.60,61.76 L19.65,67.75 L18.37,66.46 z">
                                                    <Path.RenderTransform>
                                                        <TransformGroup>
                                                            <RotateTransform Angle="45" />
                                                            <TranslateTransform X="0.06"
                                                                                Y="-0.01" />
                                                        </TransformGroup>
                                                    </Path.RenderTransform>
                                                    <Path.Effect>
                                                        <DropShadowEffect BlurRadius="8"
                                                                          Color="#FFFFFFFF"
                                                                          Direction="100"
                                                                          ShadowDepth="0" />
                                                    </Path.Effect>
                                                    <Path.OpacityMask>
                                                        <LinearGradientBrush EndPoint="0.74,0.66"
                                                                             StartPoint="-0.44,-0.11">
                                                            <GradientStop Color="#7F000000"
                                                                          Offset="0" />
                                                            <GradientStop Color="#BF000000"
                                                                          Offset="0.25" />
                                                            <GradientStop Color="#FF000000"
                                                                          Offset="1" />
                                                        </LinearGradientBrush>
                                                    </Path.OpacityMask>
                                                </Path>
                                            </Button>
                                        </StackPanel>
                                    </Grid>
                                    <ScrollViewer Style="{StaticResource CustomScrollViewerStyle}"
                                                  Background="{x:Null}"
                                                  IsTabStop="False"
                                                  Padding="{TemplateBinding Padding}"
                                                  Grid.Row="2"
                                                  VerticalScrollBarVisibility="Auto"
                                                  BorderThickness="0"
                                                  Margin="0,-8,0,0">
                                        <ContentPresenter x:Name="ContentPresenter"
                                                          Margin="0,10,-9,10" />
                                    </ScrollViewer>
                                    <StackPanel Margin="0,0,0,0"
                                                Grid.Row="0">
                                        <dataInput:ValidationSummary IsHitTestVisible="False"
                                                                     x:Name="ValidationSummary"
                                                                     MaxHeight="100"
                                                                     Padding="0"
                                                                     BorderThickness="1,1,1,1"
                                                                     BorderBrush="#FFDC020D"
                                                                     Margin="0,0,0,0"
                                                                     Visibility="Visible"
                                                                     Background="#FFDC020D">
                                            <dataInput:ValidationSummary.Template>
                                                <ControlTemplate TargetType="dataInput:ValidationSummary">
                                                    <Grid x:Name="ValidationSummary">
                                                        <VisualStateManager.VisualStateGroups>
                                                            <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal" />
                                                                <VisualState x:Name="Disabled">
                                                                    <Storyboard>
                                                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisual"
                                                                                                       Storyboard.TargetProperty="Visibility"
                                                                                                       Duration="0">
                                                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                                                    Value="Visible" />
                                                                        </ObjectAnimationUsingKeyFrames>
                                                                    </Storyboard>
                                                                </VisualState>
                                                            </VisualStateGroup>
                                                            <VisualStateGroup x:Name="ValidationStates">
                                                                <VisualState x:Name="Empty">
                                                                    <Storyboard>
                                                                        <DoubleAnimation Storyboard.TargetName="Content"
                                                                                         Storyboard.TargetProperty="(FrameworkElement.Height)"
                                                                                         Duration="00:00:00.3000000"
                                                                                         To="0" />
                                                                    </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="HasErrors">
                                                                    <Storyboard>
                                                                        <DoubleAnimation Storyboard.TargetName="Content"
                                                                                         Storyboard.TargetProperty="(FrameworkElement.Height)"
                                                                                         Duration="00:00:00.3000000"
                                                                                         To="25" />
                                                                    </Storyboard>
                                                                </VisualState>
                                                            </VisualStateGroup>
                                                        </VisualStateManager.VisualStateGroups>
                                                        <Border x:Name="Content"
                                                                Height="0"
                                                                BorderBrush="{TemplateBinding BorderBrush}"
                                                                BorderThickness="{TemplateBinding BorderThickness}"
                                                                Background="{TemplateBinding Background}"
                                                                CornerRadius="0,0,2,2">
                                                            <Grid>
                                                                <Grid.RowDefinitions>
                                                                    <RowDefinition Height="Auto" />
                                                                    <RowDefinition Height="*" />
                                                                </Grid.RowDefinitions>
                                                                <ListBox x:Name="SummaryListBox"
                                                                         Grid.Row="1"
                                                                         Background="{x:Null}"
                                                                         BorderThickness="0"
                                                                         Height="Auto"
                                                                         ItemContainerStyle="{TemplateBinding ErrorStyle}"
                                                                         Style="{TemplateBinding SummaryListBoxStyle}"
                                                                         Padding="{TemplateBinding Padding}"
                                                                         Foreground="{TemplateBinding Foreground}">
                                                                    <ListBox.ItemTemplate>
                                                                        <DataTemplate>
                                                                            <TextBlock Text="{Binding Message}"
                                                                                       Foreground="White"
                                                                                       Margin="4,0,0,0" />
                                                                        </DataTemplate>
                                                                    </ListBox.ItemTemplate>
                                                                </ListBox>
                                                                <Border x:Name="DisabledVisual"
                                                                        Visibility="Collapsed"
                                                                        Background="#80FFFFFF"
                                                                        Grid.RowSpan="2"
                                                                        IsHitTestVisible="True" />
                                                                <ContentControl x:Name="HeaderContentControl"
                                                                                Visibility="Collapsed" />
                                                            </Grid>
                                                        </Border>
                                                    </Grid>
                                                </ControlTemplate>
                                            </dataInput:ValidationSummary.Template>
                                        </dataInput:ValidationSummary>
                                    </StackPanel>
                                    <StackPanel HorizontalAlignment="Right"
                                                Orientation="Horizontal"
                                                Visibility="Collapsed">
                                        <Button x:Name="CommitButton"
                                                Margin="0,5,8,5"
                                                MinHeight="17"
                                                MinWidth="71"
                                                Visibility="Collapsed"
                                                HorizontalContentAlignment="Center"
                                                VerticalContentAlignment="Center"
                                                Content="OK" />
                                        <Button x:Name="CancelButton"
                                                Margin="0,5,8,5"
                                                MinHeight="17"
                                                MinWidth="71"
                                                Visibility="Collapsed"
                                                HorizontalContentAlignment="Center"
                                                VerticalContentAlignment="Center"
                                                Content="Cancel" />
                                    </StackPanel>
                                </Grid>
                            </Border>
                            <Border x:Name="DisabledVisual"
                                    IsHitTestVisible="False"
                                    Opacity="0"
                                    Background="#8CFFFFFF"
                                    CornerRadius="2" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="BusyControlStyle"
               TargetType="toolkitControls:BusyIndicator">
            <Setter Property="DisplayAfter"
                    Value="00:00:00.00" />
            <Setter Property="OverlayStyle">
                <Setter.Value>
                    <Style TargetType="Rectangle">
                        <Setter Property="Visibility"
                                Value="Collapsed" />
                    </Style>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Login Button Style -->
        <Style x:Key="LoginButtonStyle"
               TargetType="Button">
            <Setter Property="Width"
                    Value="75" />
            <Setter Property="Height"
                    Value="23" />
            <Setter Property="Margin"
                    Value="0,0,79,1" />
            <Setter Property="HorizontalAlignment"
                    Value="Right" />
            <Setter Property="VerticalAlignment"
                    Value="Bottom" />
        </Style>
    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <toolkitControls:BusyIndicator x:Name="activity"
                                       Style="{StaticResource BusyControlStyle}"
                                       BusyContent="{Binding Path=ApplicationStrings.ActivityLoggingIn, Source={StaticResource ResourceWrapper}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <StackPanel Orientation="Vertical">
                    <dataform:DataForm x:Name="loginForm"
                                       CurrentItem="{Binding}"
                                       AutoEdit="True"
                                       CommandButtonsVisibility="None"
                                       HeaderVisibility="Collapsed"
                                       Grid.Row="0"
                                       MinWidth="370"
                                       Margin="8,0,8,0"
                                       Style="{StaticResource LoginDataFormStyle}">
                        <dataform:DataForm.EditTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <dataform:DataField Label="Username"
                                                        IsRequired="True">
                                        <TextBox x:Name="UsernameTextbox"
                                                 TextChanged="EnableOrDisableOKButton"
                                                 Text="{Binding Username, Mode=TwoWay}" />
                                    </dataform:DataField>
                                    <dataform:DataField Label="Password"
                                                        IsRequired="True">
                                        <PasswordBox x:Name="Password"
                                                     PasswordChanged="EnableOrDisableOKButton"
                                                     Password="{Binding Password, Mode=TwoWay}" />
                                    </dataform:DataField>
                                    <dataform:DataField Label="Keep me signed in">
                                        <CheckBox IsChecked="{Binding RememberMe, Mode=TwoWay}" />
                                    </dataform:DataField>
                                </StackPanel>
                            </DataTemplate>
                        </dataform:DataForm.EditTemplate>
                    </dataform:DataForm>
                </StackPanel>

                <Button x:Name="loginCancel"
                        Content="{Binding Path=ApplicationStrings.CancelButton, Source={StaticResource ResourceWrapper}}"
                        Click="CancelButton_Click"
                        Margin="0,0,0,1"
                        Grid.Row="1"
                        Style="{StaticResource LoginButtonStyle}" />
                <Button x:Name="loginButton"
                        Content="{Binding Path=ApplicationStrings.OKButton, Source={StaticResource ResourceWrapper}}"
                        Click="LoginButton_Click"
                        Grid.Row="1"
                        Style="{StaticResource LoginButtonStyle}"
                        IsEnabled="False"/>
            </Grid>
        </toolkitControls:BusyIndicator>
    </Grid>
</UserControl>
